<?php
    $orderList = $_POST['table-1'];
    
    $i = 1;
    
    $result = array();
    
    foreach($orderList as $value)
    {
        if($value!=''){
            $sql = 'UPDATE strategic_communications SET sc_position='.($i++).' WHERE sc_id='.$value;
            $result = $db->Execute($sql);
            if($result)
            {
                $result2[] = 'success';
            }
            else
            {
                $result2[] = 'fail';
            }
        }
    }
    
    if(in_array('fail',$result2))
    {
        echo 'fail';
    }
    else
    {
        echo 'success';
    }
?>